# Define the correct MIME type for specific languages
AddType text/html .bn
AddType text/html .el
AddType text/html .nb
AddType text/html .pl
AddType text/html .tr
AddType text/html .es
 
AddLanguage af .af
AddLanguage ar .ar
AddLanguage as .as
AddLanguage ast .ast
AddLanguage bal .bal
AddLanguage bg .bg
AddLanguage bn .bn
AddLanguage bn-in .bn_IN
AddLanguage br .br
AddLanguage ca .ca
AddLanguage cs .cs
AddLanguage da .da
AddLanguage de .de
AddLanguage de-ch .de_CH
AddLanguage el .el
AddLanguage en .en
AddLanguage en-gb .en_GB
AddLanguage es .es
AddLanguage eu .eu
AddLanguage fa .fa
AddLanguage fi .fi
AddLanguage fr .fr
AddLanguage gl .gl
AddLanguage gu .gu
AddLanguage he .he
AddLanguage hi .hi
AddLanguage hu .hu
AddLanguage ia .ia
AddLanguage id .id
AddLanguage is .is
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ka .ka
AddLanguage kn .kn
AddLanguage ko .ko
AddLanguage lv .lv
AddLanguage ml .ml
AddLanguage mr .mr
AddLanguage nb .nb
AddLanguage nl .nl
AddLanguage or .or
AddLanguage pa .pa
AddLanguage pl .pl
AddLanguage pt .pt
AddLanguage pt-br .pt_BR
AddLanguage ro .ro
AddLanguage ru .ru
AddLanguage sk .sk
AddLanguage sq .sq
AddLanguage sr .sr
AddLanguage sv .sv
AddLanguage ta .ta
AddLanguage te .te
AddLanguage tg .tg
AddLanguage th .th
AddLanguage tr .tr
AddLanguage uk .uk
AddLanguage vi .vi
AddLanguage zh-cn .zh_CN
AddLanguage zh-tw .zh_TW

LanguagePriority en
ForceLanguagePriority Prefer Fallback

AddDefaultCharset utf-8

RewriteEngine on

RewriteCond %{QUERY_STRING} ^lang=(af|ar|as|ast|bal|bg|bn|bn_IN|br|ca|cs|da|de|de_CH|el|en|en_GB|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|kn|ko|lv|ml|mr|nb|nl|or|pa|pl|pt|pt_BR|ro|ru|sk|sq|sr|sv|ta|te|tg|th|tr|uk|vi|zh_CN|zh_TW)$
RewriteRule ^(?:/(?:af|ar|as|ast|bal|bg|bn|bn_IN|br|ca|cs|da|de|de_CH|el|en|en_GB|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|kn|ko|lv|ml|mr|nb|nl|or|pa|pl|pt|pt_BR|ro|ru|sk|sq|sr|sv|ta|te|tg|th|tr|uk|vi|zh_CN|zh_TW))?(/.*)$ /%1$1? [R=301]
AliasMatch ^(?:/(?:af|ar|as|ast|bal|bg|bn|bn_IN|br|ca|cs|da|de|de_CH|el|en|en_GB|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|kn|ko|lv|ml|mr|nb|nl|or|pa|pl|pt|pt_BR|ro|ru|sk|sq|sr|sv|ta|te|tg|th|tr|uk|vi|zh_CN|zh_TW))(/.*)?$ /srv/web/boot.fedoraproject.org$1

<Directory /srv/web/boot.fedoraproject.org>
  Options MultiViews

  SetEnvIf Request_URI ^/af/ prefer-language=af
  SetEnvIf Request_URI ^/ar/ prefer-language=ar
  SetEnvIf Request_URI ^/as/ prefer-language=as
  SetEnvIf Request_URI ^/ast/ prefer-language=ast
  SetEnvIf Request_URI ^/bal/ prefer-language=bal
  SetEnvIf Request_URI ^/bg/ prefer-language=bg
  SetEnvIf Request_URI ^/bn/ prefer-language=bn
  SetEnvIf Request_URI ^/bn_IN/ prefer-language=bn-in
  SetEnvIf Request_URI ^/br/ prefer-language=br
  SetEnvIf Request_URI ^/ca/ prefer-language=ca
  SetEnvIf Request_URI ^/cs/ prefer-language=cs
  SetEnvIf Request_URI ^/da/ prefer-language=da
  SetEnvIf Request_URI ^/de/ prefer-language=de
  SetEnvIf Request_URI ^/de_CH/ prefer-language=de-ch
  SetEnvIf Request_URI ^/el/ prefer-language=el
  SetEnvIf Request_URI ^/en/ prefer-language=en
  SetEnvIf Request_URI ^/en_GB/ prefer-language=en-gb
  SetEnvIf Request_URI ^/es/ prefer-language=es
  SetEnvIf Request_URI ^/eu/ prefer-language=eu
  SetEnvIf Request_URI ^/fa/ prefer-language=fa
  SetEnvIf Request_URI ^/fi/ prefer-language=fi
  SetEnvIf Request_URI ^/fr/ prefer-language=fr
  SetEnvIf Request_URI ^/gl/ prefer-language=gl
  SetEnvIf Request_URI ^/gu/ prefer-language=gu
  SetEnvIf Request_URI ^/he/ prefer-language=he
  SetEnvIf Request_URI ^/hi/ prefer-language=hi
  SetEnvIf Request_URI ^/hu/ prefer-language=hu
  SetEnvIf Request_URI ^/ia/ prefer-language=ia
  SetEnvIf Request_URI ^/id/ prefer-language=id
  SetEnvIf Request_URI ^/is/ prefer-language=is
  SetEnvIf Request_URI ^/it/ prefer-language=it
  SetEnvIf Request_URI ^/ja/ prefer-language=ja
  SetEnvIf Request_URI ^/ka/ prefer-language=ka
  SetEnvIf Request_URI ^/kn/ prefer-language=kn
  SetEnvIf Request_URI ^/ko/ prefer-language=ko
  SetEnvIf Request_URI ^/lv/ prefer-language=lv
  SetEnvIf Request_URI ^/ml/ prefer-language=ml
  SetEnvIf Request_URI ^/mr/ prefer-language=mr
  SetEnvIf Request_URI ^/nb/ prefer-language=nb
  SetEnvIf Request_URI ^/nl/ prefer-language=nl
  SetEnvIf Request_URI ^/or/ prefer-language=or
  SetEnvIf Request_URI ^/pa/ prefer-language=pa
  SetEnvIf Request_URI ^/pl/ prefer-language=pl
  SetEnvIf Request_URI ^/pt/ prefer-language=pt
  SetEnvIf Request_URI ^/pt_BR/ prefer-language=pt-br
  SetEnvIf Request_URI ^/ro/ prefer-language=ro
  SetEnvIf Request_URI ^/ru/ prefer-language=ru
  SetEnvIf Request_URI ^/sk/ prefer-language=sk
  SetEnvIf Request_URI ^/sq/ prefer-language=sq
  SetEnvIf Request_URI ^/sr/ prefer-language=sr
  SetEnvIf Request_URI ^/sv/ prefer-language=sv
  SetEnvIf Request_URI ^/ta/ prefer-language=ta
  SetEnvIf Request_URI ^/te/ prefer-language=te
  SetEnvIf Request_URI ^/tg/ prefer-language=tg
  SetEnvIf Request_URI ^/th/ prefer-language=th
  SetEnvIf Request_URI ^/tr/ prefer-language=tr
  SetEnvIf Request_URI ^/uk/ prefer-language=uk
  SetEnvIf Request_URI ^/vi/ prefer-language=vi
  SetEnvIf Request_URI ^/zh_CN/ prefer-language=zh-cn
  SetEnvIf Request_URI ^/zh_TW/ prefer-language=zh-tw
</Directory>
